package com.zerous.simplerts.object;
import java.util.*;
import com.zerous.simplerts.*;
import com.zerous.simplerts.ui.*;

public class Layer
{
	List<GameObject> children;
	List<UIBase> guis;
	
	public Layer()
	{
		children = new ArrayList<GameObject>();
	}
	
	public void addChild(GameObject go)
	{
		children.add(go);
	}
	
	public void update()
	{
		for(GameObject go:children)
		{
			//go.position.add(go.velocity);
			if(go.controler != null) go.controler.update(go);
		}
	}
	
	public void draw()
	{
		for(GameObject go:children)
		{
			Zef.graphics.drawSprite(go.src, go.position.x, go.position.y);
		}
	}
}
